/*
 * @(#)UserRecord.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.user.bean;

import java.sql.Timestamp;

import com.dcivision.framework.Utility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.user.core.PreferenceManager;

/**
  UserRecord.java

  This class is the serializable bean reflecting business logic uses.

    @author           Rollo Chan
    @company          DCIVision Limited
    @creation date    08/07/2003
    @version          $Revision: 1.14.22.1 $
*/

public class UserRecord extends AbstractBaseObject {

  public static final String REVISION = "$Revision: 1.14.22.1 $";

  static final long serialVersionUID = 1393716295157533855L;

  public final static String USER_TYPE_STAFF = "S";
  public final static String USER_TYPE_CONTACT = "C";

  private String loginName = null;
  private String loginPwd = null;
  private String modifyLoginPwd = null;
  private String firstName = null;
  private String lastName = null;
  private String fullName = null;
  private String email = null;
  private Integer failedAttempt = null;
  private Integer maxAttempt = null;
  private Integer pwdExpiryDay = null;
  private Timestamp lastPwdUpdateDate = null;
  private String status = null;
  private String userType = null;
  private Integer userLinkID = null;
  private Integer preference = null;
  private String locale = null;
  private String userDef1 = null;
  private String userDef2 = null;
  private String userDef3 = null;
  private String userDef4 = null;
  private String userDef5 = null;

  public UserRecord() {
    super();
  }

  public String getLoginName() {
    return(this.loginName);
  }

  public void setLoginName(String loginName) {
    this.loginName = loginName;
  }

  public String getLoginPwd() {
    return(this.loginPwd);
  }

  public void setLoginPwd(String loginPwd) {
    this.loginPwd = loginPwd;
  }

  public String getFirstName() {
    return(this.firstName);
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return(this.lastName);
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getFullName() {
    if (!Utility.isEmpty(this.fullName)) {
      return(this.fullName);
    } else {
      return(this.firstName + " " + this.lastName);
    }
  }

  public void setFullName(String fullName) {
    this.fullName = fullName;
  }

  public String getEmail() {
    return(this.email);
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public Integer getFailedAttempt() {
    return(this.failedAttempt);
  }

  public void setFailedAttempt(Integer failedAttempt) {
    this.failedAttempt = failedAttempt;
  }

  public Integer getMaxAttempt() {
    return(this.maxAttempt);
  }

  public void setMaxAttempt(Integer maxAttempt) {
    this.maxAttempt = maxAttempt;
  }

  public Integer getPwdExpiryDay() {
    return(this.pwdExpiryDay);
  }

  public void setPwdExpiryDay(Integer pwdExpiryDay) {
    this.pwdExpiryDay = pwdExpiryDay;
  }

  public Timestamp getLastPwdUpdateDate() {
    return(this.lastPwdUpdateDate);
  }

  public void setLastPwdUpdateDate(Timestamp lastPwdUpdateDate) {
    this.lastPwdUpdateDate = lastPwdUpdateDate;
  }

  public String getStatus() {
    return(this.status);
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getUserType() {
    return(this.userType);
  }

  public void setUserType(String userType) {
    this.userType = userType;
  }

  public Integer getUserLinkID() {
    return(this.userLinkID);
  }

  public void setUserLinkID(Integer userLinkID) {
    this.userLinkID = userLinkID;
  }

  public Integer getPreference() {
    return PreferenceManager.getValidPreference(this.preference);//return the current Preference
  }

  public void setPreference(Integer preference) {
    this.preference = preference;
  }

  public String getLocale() {
    return(this.locale);
  }

  public void setLocale(String locale) {
    this.locale = locale;
  }

  public String getUserDef1() {
    return(this.userDef1);
  }

  public void setUserDef1(String userDef1) {
    this.userDef1 = userDef1;
  }

  public String getUserDef2() {
    return(this.userDef2);
  }

  public void setUserDef2(String userDef2) {
    this.userDef2 = userDef2;
  }

  public String getUserDef3() {
    return(this.userDef3);
  }

  public void setUserDef3(String userDef3) {
    this.userDef3 = userDef3;
  }

  public String getUserDef4() {
    return(this.userDef4);
  }

  public void setUserDef4(String userDef4) {
    this.userDef4 = userDef4;
  }

  public String getUserDef5() {
    return(this.userDef5);
  }

  public void setUserDef5(String userDef5) {
    this.userDef5 = userDef5;
  }

public String getModifyLoginPwd() {
	return modifyLoginPwd;
}

public void setModifyLoginPwd(String modifyLoginPwd) {
	this.modifyLoginPwd = modifyLoginPwd;
}

}
